From 4be8185c540efaed40bd081e150e2f8313ac7ddf Mon Sep 17 00:00:00 2001 From: oliskoli Date: Tue, 6 Dec 2005 00:25:47 +0000 Subject: [PATCH] Minor GPSBabelGUI-2 updates. --- gpsbabel/win32/gui-2/gnugettext.pas | 5 +- gpsbabel/win32/gui-2/gnugettextD4.pas | 69 ++------------------------- gpsbabel/win32/gui-2/gnugettextDx.pas | 30 ------------ 3 files changed, 6 insertions(+), 98 deletions(-) diff --git a/gpsbabel/win32/gui-2/gnugettext.pas b/gpsbabel/win32/gui-2/gnugettext.pas index 23253e03c..982dea0ae 100644 --- a/gpsbabel/win32/gui-2/gnugettext.pas +++ b/gpsbabel/win32/gui-2/gnugettext.pas @@ -3,8 +3,8 @@ unit gnugettext; (* *) (* (C) Copyright by Lars B. Dybdahl and others *) (* E-mail: Lars@dybdahl.dk, phone +45 70201241 *) -(* File version: $Date: 2005-11-20 21:24:43 $ *) -(* Revision: $Revision: 1.2 $ *) +(* File version: $Date: 2005-12-06 00:25:47 $ *) +(* Revision: $Revision: 1.3 $ *) (* *) (* Contributors: Peter Thornqvist, Troy Wolbrink, *) (* Frank Andreas de Groot, Igor Siticov, *) @@ -96,6 +96,7 @@ uses {$ifdef MSWINDOWS} Windows, + Delphi, {$else} Libc, {$endif} diff --git a/gpsbabel/win32/gui-2/gnugettextD4.pas b/gpsbabel/win32/gui-2/gnugettextD4.pas index 3d378f675..bed4d3066 100644 --- a/gpsbabel/win32/gui-2/gnugettextD4.pas +++ b/gpsbabel/win32/gui-2/gnugettextD4.pas @@ -1,6 +1,6 @@ unit gnugettextD4; -(* File version: $Date: 2005-11-20 21:28:09 $ *) -(* Revision: $Revision: 1.2 $ *) +(* File version: $Date: 2005-12-06 00:25:47 $ *) +(* Revision: $Revision: 1.3 $ *) // Delphi 5 optimized interface for gnugettext.pas // This unit must only be used on Delphi 5. When you upgrade to Delphi 6 or // later, you should remove this unit and replace all reference to gnugettextD5 @@ -10,7 +10,7 @@ interface uses Classes, TypInfo; - + // Ansistring versions of the api function _(const szMsgId: string): string; function gettext(const szMsgId: string): string; @@ -43,11 +43,6 @@ procedure FreeAndNil(var P); function IncludeTrailingBackSlash(const Path: string): string; function ExcludeTrailingBackslash(const Path: string): string; -function GetStrProp(Instance: TObject; const Name: string): string; overload; -function GetStrProp(Instance: TObject; Info: PPropInfo): string; overload; -procedure SetStrProp(Instance: TObject; const Name, Value: string); overload; -procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string); overload; - implementation uses @@ -292,62 +287,4 @@ begin SetString(Result, PChar(Path), Len); end; -function GetPropInfo(Instance: TObject; const Name: string; var PropInfo: TPropInfo): Boolean; -var - Props: PPropList; - TypeData: PTypeData; - Info: PPropInfo; - i: Integer; -begin - TypeData := GetTypeData(Instance.ClassInfo); - if ((TypeData <> nil) and (TypeData^.PropCount > 0)) then - begin - GetMem(Props, TypeData^.PropCount * sizeof(Pointer)); - try - GetPropInfos(Instance.ClassInfo, Props); - for i := 0 to TypeData.PropCount - 1 do - begin - Info := Props[i]; - if (AnsiCompareText(Info.Name, Name) = 0) then - begin - PropInfo := Info^; - Result := True; - Exit; - end - end; - finally - FreeMem(Props); - end; - end; - Result := False; -end; - -function GetStrProp(Instance: TObject; Info: PPropInfo): string; -begin - Result := TypInfo.GetStrProp(Instance, Info); -end; - -function GetStrProp(Instance: TObject; const Name: string): string; -var - Info: TPropInfo; -begin - if GetPropInfo(Instance, Name, Info) then - Result := TypInfo.GetStrProp(Instance, @Info) - else - Result := ''; -end; - -procedure SetStrProp(Instance: TObject; const Name, Value: string); -var - Info: TPropInfo; -begin - if GetPropInfo(Instance, Name, Info) then - SetStrProp(Instance, @Info, Value); -end; - -procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string); -begin - TypInfo.SetStrProp(Instance, Info, Value); -end; - end. diff --git a/gpsbabel/win32/gui-2/gnugettextDx.pas b/gpsbabel/win32/gui-2/gnugettextDx.pas index 4505645e3..af1c713b8 100644 --- a/gpsbabel/win32/gui-2/gnugettextDx.pas +++ b/gpsbabel/win32/gui-2/gnugettextDx.pas @@ -19,13 +19,6 @@ function gettext(const szMsgId: string): string; function dgettext(const szDomain: string; const szMsgId: string): string; procedure TranslateComponent(AnObject: TComponent); -{$IFDEF VER120} -function GetStrProp(Instance: TObject; const Name: string): string; overload; -function GetStrProp(Instance: TObject; Info: PPropInfo): string; overload; -procedure SetStrProp(Instance: TObject; const Name, Value: string); overload; -procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string); overload; -{$ENDIF} - implementation function _(const szMsgId: string): string; @@ -76,27 +69,4 @@ begin {$ENDIF}{$ENDIF} end; -{$IFDEF VER120} -function GetStrProp(Instance: TObject; const Name: string): string; -begin - Result := gnugettextD4.GetStrProp(Instance, Name); -end; - -function GetStrProp(Instance: TObject; Info: PPropInfo): string; -begin - Result := gnugettextD4.GetStrProp(Instance, Info); -end; - -procedure SetStrProp(Instance: TObject; const Name, Value: string); -begin - gnugettextD4.SetStrProp(Instance, Name, Value); -end; - -procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string); -begin - gnugettextD4.SetStrProp(Instance, Info, Value); -end; - -{$ENDIF} - end. -- 2.30.2